package com.zkthink.ceres.member.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

@Getter
public enum SalesTypeEnum {
    //分销类型
    PRACTICAL_RECOMMEND(1, "实习分销"),
    SENIOR_SUBORDINATE(2, "资深分销"),
    CHIEF_SUBORDINATE(3, "首席分销"),
    ;

    private int code;

    private String desc;

    SalesTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SalesTypeEnum getDscByType(Integer type) {
        for (SalesTypeEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }

}
